import Vue from 'vue'
import Router from 'vue-router'
import home from '@/page/home/home'
import about from '@/page/about/about'
import downloadApp from '@/page/downloadApp/downloadApp'
import read from '@/page/read/read'
import readDetail from '@/page/read/components/readDetail' 
import one from "@/page/one/one"
import oneDetail from "@/page/one/components/oneDetail"
import music from '@/page/music/music'
import musicDetail from '@/page/music/components/musicDetail'
import movie from '@/page/movie/movie'
import movieDetail from '@/page/movie/components/movieDetail'
Vue.use(Router)

export default new Router({
  routes: [
  	{
  		path:'/',
  		redirect:'home'
  	},
    {
      path: '/home',
      name: 'home',
      component: home
    },
    {
      path: '/about',
      name: 'about',
      component:about
    },
    {
      path: '/download',
      name: 'downloadApp',
      component:downloadApp
    },
    {
      path:'/read',
      name:'read',
      component:read
    },
    {
      path:'/read/:read_id',
      name:'readDetail',
      component:readDetail
    },
    {
      path:'/one',
      name:'one',
      component:one
    },
    {
      path:'/one/:one_id',
      name:'oneDetail',
      component:oneDetail
    },
    {
      path:'/music',
      name:'music',
      component:music
    },
    {
      path:'/music/:music_id',
      name:'musicDetail',
      component:musicDetail
    },
    {
      path:'/movie',
      name:'movie',
      component:movie
    },
    {
      path:'/movie/:movie_id',
      name:'movieDetail',
      component:movieDetail
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
